<?php
/**
 * Created by PhpStorm.
 * User: VJLau
 * Date: 2018/2/5
 * Time: 下午5:55
 */

$member = unserialize(base64_decode($_SESSION['vj_member']));
$op = empty($_GPC['op']) ? '' : $_GPC['op'];
if ($op == 'detail') {
    //用户信息页面
    $title = '个人资料';
    include $this->template('member_detail');
} elseif ($op == 'real_name_edit') {
    //修改真实姓名
    $title = '真实姓名重置';
    include $this->template('real_name_edit');
} else if ($op == 'mobile_edit') {
    //修改手机号
    $title = '手机重置';
    include $this->template('mobile_edit');
} elseif ($op == 'mobile_edit2') {
    //重置手机号
    $title = '手机重置';
    include $this->template('mobile_edit2');

} elseif ($op == 'email_edit') {
    //修改邮箱
    $title = '邮箱重置';
    include $this->template('email_edit');

} else {
    //统计
    $single_order_count = pdo_fetchcolumn("SELECT COUNT(*) FROM "
        . tablename('bontrip_single_order') . " WHERE uniacid = '{$uniacid}' AND member_id = {$member['id']} AND status = 0 AND deleted_at IS NULL");
    $oneday_order_count = pdo_fetchcolumn("SELECT COUNT(*) FROM "
        . tablename('bontrip_oneday_order') . " WHERE uniacid = '{$uniacid}' AND member_id = {$member['id']} AND status = 0 AND deleted_at IS NULL");
    $quality_order_count = pdo_fetchcolumn("SELECT COUNT(*) FROM "
        . tablename('bontrip_quality_order') . " WHERE uniacid = '{$uniacid}' AND member_id = {$member['id']} AND status = 0 AND deleted_at IS NULL");
    $insurance_order_count = pdo_fetchcolumn("SELECT COUNT(*) FROM "
        . tablename('bontrip_insurance_order') . " WHERE uniacid = '{$uniacid}' AND member_id = {$member['id']} AND status = 0 AND deleted_at IS NULL");

    $title = '我的';
    include $this->template('me');
}

